<div class="nav-sub w1180">
	<ul class="zoom">
		<li><a href="/crm/crmuser/index">用户管理</a></li>
		<li><a class="on" href="/crm/crmuser/group">用户组管理</a></li>
	</ul>
</div>
<div class="main-ct w1180">
<!-- 		<a href="javascript:;" class="btn-cs btn-blue btn-fillet mt10">返 回</a> -->
	<form id="form1" method="post" action="/crm/crmuser/insert-group">
	<div class="main-ct w1180">
		<div class="form-info form-kv mt20">
		<dl>
			<dt>用户组名称：</dt>
			<dd><input name="group_name" id="group_name" type="text" class="txt"></dd>
		</dl>
            <hr>
            <span>权限设置</span>
			<?php 
    			$menu_code = '';
    			foreach ($this->powerList as $key => $power):
			         if($menu_code != $power['menu_code']):
			         $menu_code = $power['menu_code'];
			         if($key != 0):
			?>
				</dd>
			</dl>
			<?php endif;?>
    			<dl>
    				<dt><?php echo $power['menu_name'];?>：&nbsp;<label><input type="checkbox" onclick="selectAll(this,'menu_<?php echo $power['menu_code'];?>')">全选</label>&nbsp;&nbsp;</dt>
    				<dd class="check-list">
    					<label><input type="checkbox" name="power_check_<?php echo $key;?>" class="menu_<?php echo $power['menu_code'];?>" value="<?php echo $power['power_id'];?>"><?php echo $power['power_name'];?></label>
			
			
			<?php else:?>
						<label><input type="checkbox" name="power_check_<?php echo $key;?>" class="menu_<?php echo $power['menu_code'];?>" value="<?php echo $power['power_id'];?>"><?php echo $power['power_name'];?></label>
			<?php endif;?>
			
			
			<?php endforeach;?>
							</dd>
			</dl>

		</div>
	</div>
	<p class="mt30 txt-center"><input class="input-cs btn-fillet btn-green" type="submit" value="确定"></p>
	</form>
</div>
<script>
$().ready(function() {
	$("#form1").validate({
		debug:true,
		rules: {
			user_account: {
				required: true,
				minlength: 6,
				maxlength: 25,
			},
		},
		submitHandler:function(form){  
            form.submit();
	    }
	});

});

function selectAll(o,menu_code){

    if(o.checked){    
        $("."+menu_code).prop("checked", true);  
    }else{    
        $("."+menu_code).prop("checked", false);  
    }
}
</script>